<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8" %>
    
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>

<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
 <base href="<%=basePath%>">   
 <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
 <title>标题</title>        
  <meta http-equiv="pragma" content="no-cache">
  <meta http-equiv="cache-control" content="no-cache">
  <meta http-equiv="expires" content="0">    
  <meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
  <meta http-equiv="description" content="This is my page">
</head>
<body>


<table border="1" width="100%">
<tr>
   <th>ID</th>
   <th>姓名</th>
   <th>年龄</th>
</tr>
<c:forEach var="row" items="${list}">
<tr>
   <td><c:out value="${row.id}"/></td>
   <td><c:out value="${row.name}"/></td>
   <td><c:out value="${row.age}"/></td>
</tr>
</c:forEach>
</table>

<table border="1" width="100%">
<tr>
   <th>ID</th>
   <th>姓名</th>
   <th>年龄</th>
</tr>
<% 
java.util.List<zdy.web.bean.User> lis=(java.util.List<zdy.web.bean.User>)request.getAttribute("list");
for (zdy.web.bean.User u: lis){ %>
<tr>
   <td><%=u.getId() %></td>
   <td><%=u.getName() %></td>
   <td><%=u.getAge() %></td>
</tr>
<%} %>

</table>
<a href="<%=basePath%>/jsp/day9/insert.jsp" >新增</a>
</body>
</html>